﻿using HtmlAgilityPack;
using MJTop.FZhan;
using ScrapySharp.Extensions;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace FangZhanConsoleApp
{
    class Program
    {

        static void Main(string[] args)
        {

            Crawler cra = new Crawler(new Uri("http://demo.126e.com/crm/"));
            cra.Cookie = "ztm3=0; ztm14=0; ztm2=0; ztm1=0; ztm5=0; ztm9=0; ztm4=0; ztm12=0; Hm_lvt_993982dbbf7ba4ad7c6f638255df6ec0=1523951685,1523979730; ASPSESSIONIDSAQARQCD=CGBEAANCFHCLJAPOCIJGEEHK; NYH3W7NDE380E=Login%5FQXZ=111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111&Login%5FGroup=6&Login%5FLevel=99&Login%5Fuid=1&Login%5FName=%E8%B6%85%E7%BA%A7%E7%AE%A1%E7%90%86%E5%91%98&Login%5FGLFW=&Login%5FAccount=admin";
            cra.Host = "demo.126e.com";
            cra.Referer = "http://demo.126e.com/login/?action=login";

            ExpressionAttrs nvc = new ExpressionAttrs();
            nvc.Add("#theme_area a", "bigpicurl");
            cra.DownAttrs = nvc;

            cra.Start();

            Console.WriteLine("执行完成！");

        }

        /// <summary>
        /// 乱码问题修复
        /// </summary>
        private static void NewMethod()
        {
            //FZhanClient client = new FZhanClient();

            //Crawler config = new Crawler("http://www.swiper.com.cn/usage/");
            //config.Cookie = "Hm_lvt_6387fcb06c7f33ad6787ab913d4e6d10=1524017798,1524017827; Hm_lpvt_6387fcb06c7f33ad6787ab913d4e6d10=1524017827";
            //config.Host = "www.swiper.com.cn";
            //config.Referer = "https://www.baidu.com/link?url=lixY2NiV9BO40P_JZUxgE-O4NDopWdd4khaozIGg80THzvsU25acN85CLzf-32ot&wd=&eqid=ebf6204700000249000000025ad6aa7f";

            //client.Save(config);
        }






    }
}
